/*
 * @FilePath: /electron-video/electron.vite.config.ts
 * @Descripttion:
 * @version: 1.0.0
 * @Author: lijinshen
 * @Date: 2024-05-16 10:09:33
 * @LastEditors: lijinshen
 * @LastEditTime: 2024-05-16 17:33:01
 */
import { resolve } from 'path'
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'

export default defineConfig({
  main: {
    plugins: [externalizeDepsPlugin()]
  },
  preload: {
    plugins: [externalizeDepsPlugin()]
  },
  renderer: {
    resolve: {
      alias: {
        '@renderer': resolve('src/renderer/src')
      }
    },
    plugins: [
      vue(),
      AutoImport({
        resolvers: [ElementPlusResolver()]
      }),
      Components({
        resolvers: [ElementPlusResolver({ importStyle: 'sass' })]
      })
    ],
    css: {
      preprocessorOptions: {
        scss: {
          additionalData: `@use "src/renderer/src/assets/element.scss" as *;`
        }
      }
    }
  }
})
